//
//  HRecoShopCell.swift
//  VastSwift
//
//  Created by BestVast on 2021/5/30.
//

import UIKit

/// 推荐商家cell
class HRecoShopCell: UICollectionViewCell {
    func uiConfig() {
        self.backgroundColor = colorTheme
        self.contentView.addSubview(logoImage)
        self.contentView.addSubview(titleLabel)
        self.contentView.addSubview(typeLabel)

        logoImage.frame = CGRect.init(x: 10, y: 10, width: self.frame.size.width / 2 - 15, height: self.frame.size.height - 20)
        logoImage.backgroundColor = .orange
        titleLabel.frame = CGRect.init(x: logoImage.right + 10, y: 10, width: self.frame.size.width / 2 - 15, height: 20)
        typeLabel.frame = CGRect.init(x: logoImage.right + 10, y: titleLabel.bottom + 5, width: self.frame.size.width / 2 - 15, height: 15)
        
        titleLabel.text = "昌伟汽配"
        typeLabel.text = "无门槛优惠券"
        
    }
    
        
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        uiConfig()
        self.layer.cornerRadius = 5
        self.layer.masksToBounds = true
        
    }
    // 左侧商家图片
    lazy var logoImage: UIImageView = {
        let logoImage = UIImageView.init()
        logoImage.backgroundColor = .white
        return logoImage
    }()
    // 商家名称
    lazy var titleLabel: UILabel = {
        let titleLabel = UILabel.init()
        titleLabel.textAlignment = .left
        titleLabel.textColor = .white
        titleLabel.backgroundColor = .clear
        titleLabel.font = .systemFont(ofSize: 16)
        return titleLabel
    }()
    // 无门槛优惠券
    lazy var typeLabel: UILabel = {
        let typeLabel = UILabel.init()
        typeLabel.textAlignment = .left
        typeLabel.textColor = .white
        typeLabel.backgroundColor = .clear
        typeLabel.font = .systemFont(ofSize: 12)
        return typeLabel
    }()
    
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
